using System.Data;

namespace Firestarter.DB.Schema.Logic
{
    public interface IDBSchemaExtractor
    {
        /// <summary>
        /// This method is the specific for the database implementation for fetching the 
        /// <see cref="DataTable"/> representing the databases for the connection with a specified database name.
        /// This database name might be used to filter the catalog, schema, or both.
        /// </summary>
        /// <param name="databaseName">The name of the database to filter by.</param>
        /// <returns>A <see cref="DataTable"/> populated with the Databases information.</returns>
        DataTable GetDatabasesDataTable(string databaseName);

        DataTable GetDatabasesDataTable(string catalogName, string schemaName);
        DataTable GetDataTypesDataTable();
        DataTable GetTablesDataTable();
        DataTable GetColumnsDataTable(string tableName);
        DataTable GetPrimaryKeyColumnsDataTable(string tableName);
        DataTable GetUniqueKeyColumnsDataTable(string tableName);

        /// <summary>
        /// Creates a <see cref="DataTable"/> for Foreign Key columns with the following <see cref="DataColumn"/>s:
        /// TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, 
        /// KEY_CATALOG, KEY_SCHEMA, KEY_NAME, COLUMN_NAME, REFERENCED_TABLE_CATALOG, 
        /// REFERENCED_TABLE_SCHEMA, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME, ORDINAL_POSITION
        /// </summary>
        /// <param name="tableName">The table name of the particular table that you are reading the foreign keys for </param>
        /// <param name="foreignKeyName">The particular foreign key of the particular table that you are reading the foreign keys for </param>
        /// <returns></returns>
        DataTable GetForeignKeyColumnsDataTable(string tableName, string foreignKeyName);

        /// <summary>
        /// Gets the current Catalog Name from the database connection.
        /// </summary>
        string CatalogName { get; }

        /// <summary>
        /// Gets the current Schema Name from the database connection.
        /// </summary>
        string SchemaName { get; }
    }
}